package com.exrobot.module.rbt.dal.mysql.robottask;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.robottask.RobotTaskDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.robottask.vo.*;

/**
 * 机器人任务 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RobotTaskMapper extends BaseMapperX<RobotTaskDO> {

    default PageResult<RobotTaskDO> selectPage(RobotTaskPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotTaskDO>()
                .eqIfPresent(RobotTaskDO::getRobotSn, reqVO.getRobotSn())
                .eqIfPresent(RobotTaskDO::getTaskType, reqVO.getTaskType())
                .betweenIfPresent(RobotTaskDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(RobotTaskDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(RobotTaskDO::getStatus, reqVO.getStatus())
                .orderByDesc(RobotTaskDO::getId));
    }

}